package com.gimi.cloud.bbp.dao.dao.bank;

import com.gimi.cloud.bbp.dao.myMapper.core.query.QueryParamProvider;
import com.gimi.cloud.bbp.dao.myMapper.MyMapper;
import com.gimi.cloud.bbp.dao.myMapper.core.query.QueryParam;
import com.gimi.cloud.bbp.dto.bank.BankDTO;
import com.gimi.cloud.bbp.entity.bank.Bank;
import org.apache.ibatis.annotations.*;

/**
 * Created by lixj on 2017/12/18.
 */
@Mapper
public interface BankDao extends MyMapper<Bank> {

    @SelectProvider(method = "selectCountBySql",type = QueryParamProvider.class)
    String useable(QueryParam param);


    BankDTO getBankByUserId(@Param(value = "userId")Integer userId);
    
    @Select("select * from rd_bank_card where card_no=#{cardNo} order by bc_id desc limit 1")
    Bank getBankBycardNo(String cardNo); 
    
    @Select("select * from rd_bank_card where user_id=#{userId} order by bc_id desc limit 1")
    Bank getBankByUserIdOrderbcId(Integer userId); 
    
}
